Script: --on wEvent wdID,wdName,objNo,objName,objValue¬global CR, gWindow, itemShown, typeShown,WSS¬if objNo = 0 then¬ if objValue = "Close" then¬ if wsGet(wdID,0,"xOldScript") <> wsGet(wdID,"theScript","TEXT") then¬ get line 1 of WindowScript("Saver", "Save changes to script before closing?")¬ if it is "Save" then¬ doSaveScript wdName¬ return the Result¬ else if it is empty then¬ return "NG"¬ end if¬ end if¬ menuSet "Go",wdName,"NAME",""¬ else if objValue = "Open" then¬ get menuGet("Go",0,"TEXT")¬ menuSet "Go",0,"TEXT", wdName & CR & it¬ else if objValue = "Suspend" then¬ menuSet "Go",wdName,"CHECKMARK",FALSE¬ else if objValue = "Resume" then¬ menuSet "Go",wdName,"CHECKMARK",TRUE¬ end if¬else if objNo = -1 then¬ put wdID into windowID¬ if objName=numtochar(20) and objNo=1 then¬ doSplash¬ else if objValue = "About WindowScript…" then¬ doSplash¬ else if objValue = "Close Script" then¬ wsSend windowID,0,"Close"¬ else if objValue = "Revert to Saved" then¬ if confirmRef(wdName) is not true then return "NG"¬ put wsGet(windowID,0,xOwnerID) into oID¬ put wsGet(windowID,0,xOwnerNumber) into oNumber¬ wsSet windowID,"theScript","TEXT",wsGet(windowID,0,xOldScript)¬ else if objValue = "Save Script" then¬ doSaveScript wdName¬ else if objValue = "Page Setup…" then¬ doMenu "Page Setup..."¬ else if objValue = "Print Script…" then¬ print wsGet(windowID,"theScript","TEXT")¬ else if objValue = "Quit HyperCard" then¬ doMenu "Quit HyperCard"¬ else if objValue = "Select All" then¬ wsSet windowID,"theScript","SELECTION","0,32000"¬ else if objValue = "Message" then¬ doMsg¬ else if objValue = "Next Window" then¬ doMenu "Next Window"¬ else if objName = "go" then¬ send "BringToFront" to window objValue¬ else if objValue = "Find…" then¬ global scriptFindString¬ ask "Find:" with scriptFindString¬ if it is not empty then¬ put it into scriptFindString¬ wsSet windowID,"theScript","SELECTIONTEXT",it¬ end if¬ else if objValue = "Find Again…" then¬ global scriptFindString¬ if scriptFindString is not empty then¬ wsSet windowID,"theScript","SELECTIONTEXT",scriptFindString¬ end if¬ else if ("A Property…" is in objValue) or (objValue="Send A Command…") then¬ put line 1 of the stacks into sk¬ put wsGet(windowID,"xOwnerID") into oID¬ push cd¬ lock screen¬ set lockmessages to true¬ go stack WSS¬ get line 2 of WindowScript((word 3 of objValue) & CR & "HitMessage: "&(word 1 of objValue)&"Hit", wsGet(oID,0,"itemList"))¬ pop cd¬ unlock screen ¬ set lockmessages to false¬ if it is not empty then¬ wsSet windowID,"theScript","TEXTOFSELECTION",it&return¬ get wsGet(windowID,"theScript","SELECTION")¬ wsSet windowID,"theScript","SELECTION",(item 2 of it) & "," & (item 2 of it)¬ end if¬ else if objValue = "Display A Window…" then ¬ put wsGet(wsGet(wdID,0,"xOwnerID"),0,"xStackName") into sk¬ get ResourceList(sk,"LENS")¬ sort it¬ get WindowScript("Windows" & CR & "Delete_Visible: FALSE" & CR & "Open As Text_Visible: FALSE" & CR & "New_Visible: FALSE" & CR & "Open_Name: Show" & CR & "WindowList_Logic: Single",it)¬ if it is not empty then¬ put quote & line 3 of it & quote into theParams¬ put LENS2Text("",line 3 of it) into lensText¬ get offset(return&"Params:",lensText)¬ if it>0 then ¬ put char it+8 to 32767 of lensText into part¬ get offset(return,part)¬ put ","&&scrunch(unscrunch(char 1 to it-1 of part),",") after theParams¬ end if¬ ¬ get "get WindowScript(" & theParams &")"¬ wsSet windowID,"theScript","TEXTOFSELECTION",it&return¬ get wsGet(windowID,"theScript","SELECTION")¬ wsSet windowID,"theScript","SELECTION",(item 2 of it) & "," & (item 2 of it)¬ end if¬ end if¬end if¬--end wEvent
Params: i0_NAME¬i1_TEXT¬i1_SELECTION
Menubar: ScriptBar
ItemType: TEXT
Rect: -1,-1,461,186
TextFont: Monaco
TextSize: 9
AutoSize: FALSE
GrowItem: TRUE
Name: theScript
LockText: FALSE
Scrolling: TRUE
Script: set cursor to watch¬formatScript wsGet(wdID,"theScript","HANDLE")